Drive Image Professional Scripting Interactive vs. Batch Mode -------------------------- Drive Image Professional may be run in one of two modes: interactive (the default) or batch mode. Interactive mode requires user input at discrete intervals, resulting in greater control and efficiency when working with one or two workstations. Alternately, batch mode is useful when loading image files onto a large number of workstations. Batch mode automates the loading process, saving you time and effort by eliminating the need for repetitive user input. Command Line Switches --------------------- In order to run in batch mode, Drive Image Professional uses a series of command line switches. To use these switches, type PQDI /switch [/switch...] where switch is one or more of the following: /? Displays all available command line switches, their syntax and a short description. /IMG= Designates a .PQI image file /CEC Checks for an extra cylinder. This corrects a problem of the BIOS and DOS reporting different maximum cylinder numbers. /CMD= Designates a script file; the script file contains commands that are passed to the program /LOG= Designates a log file /ERR= Designates an error file /SCO Syntax Check Only; this switch causes the syntax of each command in the script file to be checked without executing the command. /WFS Wipe First Sector; deletes the master boot record once all partitions are deleted with the script command DELETE ALL; only accessible using scripting. /PWD= Designates a password that must be given to restore the partition(s) data. The password may be either a number or a string. /CAS The Copy All Sectors switch causes all sectors within a partition to be saved and restored. This includes all information in a partition including the deleted files. /IFC Ignores file system checks. This allows a partition with a known file system error (e.g. cross-linked files) to be stored in an image. Likewise, that same partition can be restored if this switch is used and if during the restore process the partition does not need to be resized. /MFS=nnnnn Designates the Maximum File Size used for creating multiple files to contain a .PQI image. (nnnnn is the number of bytes in each file) /NBS Disable bad sector checking. By default bad sector checking is disabled. /CBS Enable bad sector checking. /IPE Disables partition table error checking. This switch allows drives with partition errors to be saved and restored. /UEB forces the extended BIOS to be used for disk reads and writes. /RAV causes each sector written to disk during the restore process to be read back and compared with the data just written as an extra security precaution. Using this parameter will significantly increase restore time. Command Line Examples --------------------- Scenario 1: To specify SCRIPT.TXT as the script file, ERROR.TXT as the error file and E:\IMAGES\DRIVE2.PQI as the image file: PQDI /CMD=SCRIPT.TXT /ERR=ERROR.TXT /IMG=E:\IMAGES\DRIVE2.PQI Scenario 2: To specify a syntax check for the script file SCRIPT.TXT: PQDI /CMD=SCRIPT.TXT /SCO Script Files ------------ The script file designated in the command line contains instructions, one per line, that are passed to the program, determining which operations are executed. The script file syntax is as follows: Script Argument Action --------------- ------ DELETE Deletes the last partition selected DELETE ALL Deletes all partitions on the drive DELETE EXTENDED Deletes the extended partition; the extended partition can only be deleted if all the logical drives within it have already been deleted. REBOOT Reboots the computer; any commands following this command will not be executed RESIZE IMAGE Resizes the image to the specified size when {proportional | restored; is indicated in MB no | | max} RESTORE Restores all selected images and resizes them, if specified SECTOR CHECK {on | off} Enables/Disables Bad Sector Checking for all restore operations following the command SELECT DRIVE {} Selects the drive with the specified number; the first drive is number 1 SELECT FREE SPACE Selects the specified free space {first |last | next | largest} SELECT IMAGE Selects the specified image in the image file { |all} SELECT PARTITION Selects the specified partition(s) { | | | first |next | all} SET ACTIVE Sets active the last partition selected STORE {with compression Stores all selected partitions with the {off | low | high}} indicated compression level Script File Examples -------------------- Scenario 1: To store all the partitions on drive 2 to the file, E:\IMAGES\DRIVE2.PQI: PQDI /CMD=SCRIPT.TXT /IMG=E:\IMAGES\DRIVE2.PQI SCRIPT.TXT file contents: SELECT DRIVE 2 SELECT PARTITION ALL STORE Scenario 2: To store partition 3 from drive 1, and partitions 1, 4 and 5 from drive 2 to the file, E:\IMAGES\DRIVES.PQI and have the image file split up into multiple files each 630 MB so each can be transferred to a CD-ROM: PQDI /CMD=SCRIPT.TXT /IMG=E:\IMAGES\DRIVES.PQI /MFS=630000000 SCRIPT.TXT file contents: SELECT DRIVE 1 SELECT PARTITION 3 STORE SELECT DRIVE 2 SELECT PARTITION 1 SELECT PARTITION 4 SELECT PARTITION 5 STORE Scenario 3: To restore all the images in the file, E:\IMAGES\DRIVES.PQI, to the first free space on drive 2: PQDI /CMD=SCRIPT.TXT /IMG=E:\IMAGES\DRIVES.PQI SCRIPT.TXT file contents: SELECT DRIVE 2 SELECT FREESPACE FIRST SELECT IMAGE ALL RESTORE Scenario 4: To restore the first two images in the file, E:\IMAGES\DRIVES.PQI, to the largest free space on drive 1 and resize them both proportionally: PQDI /CMD=SCRIPT.TXT /IMG=E:\IMAGES\DRIVES.PQI SCRIPT.TXT file contents: SELECT DRIVE 1 SELECT FREESPACE LARGEST SELECT IMAGE 1 SELECT IMAGE 2 RESIZE IMAGE PROPORTIONAL RESTORE Scenario 5: To restore the first two images in the file, E:\IMAGES\DRIVES.PQI, to the last free space on drive 1 and resize them to 500 MB each (The image was encrypted using the password 12345678): PQDI /CMD=SCRIPT.TXT /IMG=E:\IMAGES\DRIVES.PQI /PWD=12345678 SCRIPT.TXT file contents: SELECT DRIVE 1 SELECT FREESPACE LAST SELECT IMAGE 1 RESIZE IMAGE 500 SELECT IMAGE 2 RESIZE IMAGE 500 RESTORE Scenario 6: To delete all existing partitions on drive 2 and then restore all the images in file, E:\IMAGES\DRIVES.PQI, to the free space (The image was encrypted using the password HELLO): PQDI /CMD=SCRIPT.TXT /IMG=E:\IMAGES\DRIVES.PQI /PWD=HELLO SCRIPT.TXT file contents: SELECT DRIVE 2 DELETE ALL SELECT FREESPACE FIRST SELECT IMAGE ALL RESTORE Scenario 7: To restore the first four images in the file, E:\IMAGES\DRIVES.PQI, to the last free space on drive 1, and then resize the first image to 500 MB, keep the second the same size, and resize the third and fourth images to proportionally take up the remaining free space: PQDI /CMD=SCRIPT.TXT /IMG=E:\IMAGES\DRIVES.PQI SCRIPT.TXT file contents: SELECT DRIVE 1 SELECT FREESPACE LAST SELECT IMAGE 1 RESIZE IMAGE 500 SELECT IMAGE 2 RESIZE IMAGE NO SELECT IMAGE 3 SELECT IMAGE 4 RESIZE IMAGE PROPORTIONAL RESTORE NOTE: For further Drive Image script scenarios, visit our home page at http://www.powerquest.com.